<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		 <meta name="renderer" content="webkit">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>权限列表</title>
	</head>
	<link rel="stylesheet" href="__PUBLIC__/frame/layui/css/layui.css">
	<!--<link rel="stylesheet" href="http://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">-->
	<link rel="stylesheet" href="__PUBLIC__/frame/static/css/style.css">
	<body>
		<button class="layui-btn" style="margin-top: 10px;" onclick="location.href='<?php echo U('add');?>'"><i class="layui-icon">&#xe654;</i>添加权限</button>
    	<a class="layui-btn btn-add btn-default" id="btn-refresh" style="margin-top: 10px;"><i class="layui-icon">&#x1002;</i></a>
    	<table class="layui-table" border="" cellspacing="" cellpadding="" width="100%">
    		<thead>
    			<tr>
    				<td width="25%">权限名称</td>
    				<td width="20%">模型名称</td>
    				<td width="20%">控制器名称</td>
                    <td width="15%">方法名称</td>
                    <td width="10%">父级ID</td>
    				<td width="10%">操作</td>
    			</tr>
    		</thead>
            <tbody>
        <?php foreach ($data as $k => $v): ?>            
            <tr>
                <td><?php echo str_repeat('-', 8*$v['level']); ?><?php echo $v['pri_name']; ?></td>
                <td><?php echo $v['module_name']; ?></td>
                <td><?php echo $v['controller_name']; ?></td>
                <td><?php echo $v['action_name']; ?></td>
                <td><?php echo $v['parent_id']; ?></td>
                <td align="center">
                    <a href="<?php echo U('edit?id='.$v['id'].'&p='.I('get.p')); ?>" class="layui-btn layui-btn-mini" lay-event="edit" title="编辑">编辑</a> 
                    <a href="<?php echo U('delete?id='.$v['id'].'&p='.I('get.p')); ?>" onclick="return confirm('确定要删除吗？请在技术人员指导下操作！');" class="layui-btn layui-btn-danger layui-btn-mini hahaha" lay-event="del" title="移除">移除</a> 
                </td>
            </tr>
        <?php endforeach; ?>
            	   
            </tbody>
    	</table>
		
		
		
	</body>
	<script type="text/javascript" src="__PUBLIC__/hawk/js/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/frame/layui/layui.js"></script>
	<script>
	$(function(){
		$(document).on('click','.hahaha',function(){
			$(this).parents('tr').remove();
		});
		
        $('#btn-refresh').on('click', function () {
            location.reload();
        });
		
		
	});
	
	
	
	
</script>
</html>
